package com.chushouya.common.constant;

import com.general.framework.core.enums.IEnum;

/**
 * 评估项目选项类型
 */
public enum EvaluateItemSelectTypeEnum implements IEnum<Integer> {

    single(1, "单选"), multi(2, "多选");

    private final Integer value;

    private final String desc;

    EvaluateItemSelectTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(Integer selectType) {
        for (EvaluateItemSelectTypeEnum value : EvaluateItemSelectTypeEnum.values()) {
            if (value.value.equals(selectType)) {
                return value.desc;
            }
        }
        return "";
    }

    @Override
    public Integer value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }

    public static Boolean isMultiSelect(Integer selectType) {
        return EvaluateItemSelectTypeEnum.multi.value().intValue() == selectType;
    }
}
